using Entitas;
using UnityEngine;

public class InputSystem : IExecuteSystem
{
    InputContext mContext;
    Vector3 mClickDownPos;
    GridPosition mClickDownGridPos;
    LogicEntity mClickDownGridEntity;
    
    public InputSystem(InputContext context)
    {
        mContext = context;
    }

    public void Execute()
    {
        if (Input.GetMouseButtonDown(0)) //左键按下
        {
            mClickDownPos = Input.mousePosition;
            mClickDownGridEntity = LogicApi.GetGridEntityByMousePos(EcsManager.EcsContexts.logic, mClickDownPos);
            mClickDownGridEntity.ReplaceEliminateCell(LogicApi.Time2Frame(0.3f),0);
        }
    }
    

}
